<?php

/**
 * WaveType form base class.
 *
 * @method WaveType getObject() Returns the current form's model object
 *
 * @package    TMD
 * @subpackage form
 * @author     Thaihosting
 */
abstract class BaseWaveTypeForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'IWAVE_TYPE' => new sfWidgetFormInputHidden(),
      'SDESC_TH'   => new sfWidgetFormInputText(),
      'SDESC_ENG'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'IWAVE_TYPE' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIwaveType()), 'empty_value' => $this->getObject()->getIwaveType(), 'required' => false)),
      'SDESC_TH'   => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'SDESC_ENG'  => new sfValidatorString(array('max_length' => 100, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('wave_type[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'WaveType';
  }


}
